import 'package:flutter/material.dart';

class MyTextField {
  static Widget textFieldNone(){
    return Center(
      child: TextField(
        obscureText: true,
      ),
    );
  }

  static Widget textFieldIcon(){
    return Center(
      child: TextField(
        decoration: InputDecoration(
          icon: Icon(Icons.person)
        ),
      ),
    );
  }

  static Widget textFieldLabelText(){
    return Center(
      child: TextField(
        decoration: InputDecoration(
          labelText: "用户名",
          labelStyle: TextStyle(color: Colors.blue)
        ),
      ),
    );
  }

  static Widget textFieldHelperText(){
    return Center(
      child: TextField(
        decoration: InputDecoration(
          helperText: "用户名长度为3~8",
          helperStyle: TextStyle(color: Colors.red)
        ),
      ),
    );
  }

  static Widget textFieldHint(){
    return Center(
      child: TextField(
        decoration: InputDecoration(
          hintText: "请输入用户名",
          hintStyle: TextStyle(color: Colors.grey)
        ),
      ),
    );
  }

  static Widget textFieldPassword(){
    return Center(
      child: TextField(
        obscureText: true,
      ),
    );
  }

  static Widget textFieldMultipel(){
    return Center(
      child: TextField(
        obscureText: true,
        decoration: InputDecoration(
          border: OutlineInputBorder(),
          labelText: 'Password',
        ),
      ),
    );
  }
}